﻿using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace Deepseek_Robot.Modules.ViewModels
{
    public class RunningLogViewModel : ObservableObject
    {
        private bool _isTemplatesComboBoxEnabled = true;
        public bool IsTemplatesComboBoxEnabled
        {
            get => _isTemplatesComboBoxEnabled;
            set => SetProperty(ref _isTemplatesComboBoxEnabled, value);
        }

        private List<string> _templateNames = new List<string> { "Template1", "Template2", "Template3" };
        public List<string> TemplateNames
        {
            get => _templateNames;
            set => SetProperty(ref _templateNames, value);
        }

        private int _selectedTemplateIndex = -1;
        public int SelectedTemplateIndex
        {
            get => _selectedTemplateIndex;
            set => SetProperty(ref _selectedTemplateIndex, value);
        }

        private string _selectedTemplateName;
        public string SelectedTemplateName
        {
            get => _selectedTemplateName;
            set => SetProperty(ref _selectedTemplateName, value);
        }

        private int _previousSelectedIndex = -1;
        private string _previousSelectedName;

        public void SavePreviousSelection()
        {
            _previousSelectedIndex = SelectedTemplateIndex;
            _previousSelectedName = SelectedTemplateName;
        }

        public void RestorePreviousSelection()
        {
            SelectedTemplateIndex = _previousSelectedIndex;
            SelectedTemplateName = _previousSelectedName;
        }
    }
}